package org.karelun.rabbit.rcp.policy;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.command.DeleteCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.karelun.ideaboard.gef.editpolicies.ComponentEditPolicy;
import org.karelun.ideaboard.gef.requests.GroupRequest;
import org.karelun.rabbit.graph.Connection;

public class DeleteConnectionEditPolicy extends ComponentEditPolicy {
	
	@Override
	protected Command createDeleteCommand(GroupRequest deleteRequest) {
		Connection connection = (Connection)getHost().getModel();
		
		EditingDomain editingDomain = getEditingDomain(getHost());
		return DeleteCommand.create(editingDomain, connection);
	}
	
}
